#ifndef __DATABASE_MANAGER__
#define __DATABASE_MANAGER__

#include <string>
#include <list>
#include <QSqlQuery>
#include <QVariant>
#include "databasequery.h"

typedef std::list<QVariant> ListQVariant;

class DatabaseManager
{

  public:
    DatabaseManager(const std::string);
    virtual ~DatabaseManager();

    virtual bool     openDatabase()  = 0;
    virtual bool     closeDatabase() = 0;
    virtual QString  getLastError()  = 0;

    std::string getDatabaseType();

    void        setHostname(std::string);
    std::string getHostname();

    void setPort(int);
    int  getPort();

    void         setUserName(std::string);
    std::string getUsername();

    void        setPassword(std::string);
    std::string getPassword();

    void        setDatabaseName(std::string);
    std::string getDatabaseName();


    virtual ListQVariant query(QSqlQuery);

  protected:
    std::string          user_name;
    std::string          user_pswd;
    std::string          host_name;
    const std::string    database_type;
    std::string          database_name;
    int                  portid;

};


#endif //__DATABASE_MANAGER__
